package com.yyt.module_main.act;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.yyt.libsrc.bean.PresentRecordBean;
import com.yyt.libsrc.conf.Config;
import com.yyt.libsrc.conf.Consts;
import com.yyt.libsrc.net.JavaParamsBuilder;
import com.yyt.libsrc.net.NetUtil;
import com.yyt.libsrc.net.SuccessCallback;
import com.yyt.module_main.R;
import com.yyt.module_main.databinding.ActivityWithdrawRecordBinding;
import com.yyt.module_main.vm.WithdrawRecordVM;

import top.lixb.libcommon.base.RefreshableActivity;

public class WithdrawRecordActivity extends RefreshableActivity<ActivityWithdrawRecordBinding> {

    private WithdrawRecordVM mVm;

    @Override
    protected void init() {
        mVm = new WithdrawRecordVM();
        mRefreshContentBinding.setVm(mVm);
    }

    @Override
    protected int initRefreshLayout() {
        return R.layout.activity_withdraw_record;
    }

    @Override
    protected void getData(boolean refresh) {
        NetUtil.sellerPost(new JavaParamsBuilder()
                .addCmd(Consts.CMD.presentRecord)
                .addP("status", String.valueOf(mVm.status.get()))
                .addP("type", String.valueOf(mVm.type.get()))
                .addP("startTime", String.valueOf(mVm.startTime.get()))
                .addP("endTime", String.valueOf(mVm.endTime.get()))
                .addP("currentPage", String.valueOf(mPage))
                .addP("showCount", String.valueOf(Config.sPageSize))
                .build(), new SuccessCallback<PresentRecordBean>() {
            @Override
            public void onSuccess(PresentRecordBean presentRecordBean) {

            }
        });
    }
}
